package com.swf.jpa.service;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.swf.jpa.model.Tyebaccoinfo;
import com.swf.jpa.repository.TyebaccoinfoRepository;

@Repository
@Transactional(readOnly = true)
public class TyebaccoinfoServiceImpl implements TyebaccoinfoService {
	/*@PersistenceContext  
	private EntityManager em;*/
	@Autowired
	private TyebaccoinfoRepository repository;
	@Override
	public List<Tyebaccoinfo> findAll() {
		return repository.findAll();
	}
	@Override
	public Tyebaccoinfo findByVcTradeacco(String vcTradeacco) {
		return repository.findByVcTradeacco(vcTradeacco);
	}
	@Override
	public Tyebaccoinfo findByVcCustno(String vcCustno) {
		return repository.findByVcCustno(vcCustno);
	}
	@Override
	public List<Tyebaccoinfo> findByVcPartnerid(String vcPartnerid) {
		return repository.findByVcPartnerid(vcPartnerid);
	}
	@Override
	public List findByQuery(String sql) {
	/*	Query query = em.createQuery(sql);
		List list = query.getResultList();
		return list;*/
		return null;
	}

}
